<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        #box {
            position: absolute;
            width: 100px;
            height: 100px;
            background-color: yellow;
        }

    </style>
</head>
<body>
<button id="btn">Go!</button>
<div id="box"></div>
<script src="./animate.js"></script>
<script>
    var box = document.getElementById("box");
    var btn = document.getElementById("btn");

    btn.onclick = function() {
        animate(box, {"left" : 800, "top" : 50, "width" : 50, "height" : 200}, function(){
            animate(box,{"left" :200,  "top" : 300, "width" : 200, "height" : 300}, function(){
                animate(box,{"left" :10, "top" :100,"width" : 100,"height" : 100 })
            })
        });
    };
</script>

</body>
</html>